package com.franklin.validation.core.utils;

import com.franklin.validation.core.constants.Constants;

import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

/**
 * Description :
 * Create By: Franklin
 * Date : 2020/6/15 18:00
 */
public class IdGenerator {

    /**
     * 使用ThreadLocalRandom获取UUID获取更优的效果 去掉"-"
     */
    public static String get32UUID() {
        ThreadLocalRandom random = ThreadLocalRandom.current();
        return new UUID(random.nextLong(), random.nextLong()).toString().replace(Constants.DASH, Constants.EMPTY);
    }
}
